<?php

/**
 * <p>Converts the given string into a valid absolute path using the 
 * {@link Loader::toPaths()} method.</p>
 * 
 * <p><strong>Note:</strong> This modifier only returns the first resulting path
 * </p>
 * 
 * @param string $string The path to be converted.
 * @param string $extension = ".tpl" The extension of the required path.
 * @return string The resulting path.
 * 
 * @see Loader::toPaths() For details about the string format required by this 
 * method.
 * 
 * @throws InvalidPathException If $string is not a string, is null or is empty.
 * @throws LogicException If $extension is not a string.
 */
function smarty_modifier_ToAction($string){
    $parts = explode("::", $string);
	$app = $parts[0];
	$module = isset($parts[1]) ? $parts[1] : "";
	$task = isset($parts[2]) ? $parts[2] : "index";
	
    return ModulesContext::instance()->getRouting()->appAction($app, $module, $task);
}

?>